import Vue from 'vue';
import Home from '@/views/home/Index.vue';
import router from './router';
import store from './store';
import '@/css/normal.css';
import '@/css/common.css';
import '@/css/code.css';
import 'element-ui/lib/theme-chalk/index.css'; //样式必须引入
import '@/plugins/element.js';
import 'font-awesome/css/font-awesome.min.css';
import 'element-ui/lib/theme-chalk/display.css';
import 'nprogress/nprogress.css';
import { postKeyValueRequest } from './utils/api';
import { postRequest } from './utils/api';
import { putRequest } from './utils/api';
import { getRequest } from './utils/api';
import { deleteRequest } from './utils/api';
Vue.prototype.postKeyValueRequest = postKeyValueRequest;
Vue.prototype.postRequest = postRequest;
Vue.prototype.putRequest = putRequest;
Vue.prototype.getRequest = getRequest;
Vue.prototype.deleteRequest = deleteRequest;
Vue.config.productionTip = false;
import infiniteScroll from 'vue-infinite-scroll';
Vue.use(infiniteScroll);
// 时间格式转换
Vue.filter('dateFormat', function(originVal) {
	const dt = new Date(originVal);

	const y = dt.getFullYear();
	const m = (dt.getMonth() + 1 + '').padStart(2, '0');
	const d = (dt.getDate() + '').padStart(2, '0');

	const hh = (dt.getHours() + '').padStart(2, '0');
	const mm = (dt.getMinutes() + '').padStart(2, '0');
	const ss = (dt.getSeconds() + '').padStart(2, '0');

	return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
});

new Vue({
	router,
	store,
	render: (h) => h(Home)
}).$mount('#app');
